#include <stdio.h>
struct student{
int age;
int year;
};
void display(struct student* ptr);
int main(int argc, char* argv[]){
struct student p;
p.age = 21;
p.year = 2;
display(&p);
return 0;
}
void display(struct student* ptr){
printf("n%d and %dn",ptr->age, ptr->year);
}
of course this can be compiled and run to give the following output:
secondhalf-lm:junk clacy$ gcc struct.c -o struct && ./struct
21 and 2
christo